export default{
	//用户token
	token:false,
	//用户id
	// 初始化
	__init(){
		// 获取用户信息
		this.token = uni.getStorageSync("token");
	},
	clearTokenStorage(opts){
		opts == undefined ? uni.showToast({'title':'授权登录过期,请重新登录','icon':'none'}) : '';
		this.clearStorage();
		uni.redirectTo({
			url:'/pages/login/login'
		})
	}, 
	clearStorage(){
		uni.removeStorageSync('token');
		uni.removeStorageSync('userId');
		uni.removeStorageSync('gradeNo');
		uni.removeStorageSync('gradeName');
		uni.removeStorageSync('groupUserRole');
		uni.removeStorageSync('realName');
		uni.removeStorageSync('userPortrait');
		this.token = false;
	}
}
